
<html><HEAD>
<LINK REL=STYLESHEET HREF="default.css" TYPE="text/css">
<TITLE>
Using rich text in an application</TITLE>
</HEAD>
<BODY>

<!-- Header -->
<p class="ancestor" align="right"><A HREF="apptechp95.htm">Previous</A>&nbsp;&nbsp;<A HREF="apptechp97.htm" >Next</A>
<!-- End Header -->
<A NAME="X-REF372616647"></A><h1>Using rich text in an application</h1>
<A NAME="TI2580"></A><p>Rich text format (RTF) is a standard for specifying formatting
instructions and document content in a single ASCII document. An
editor that supports rich text format interprets the formatting
instructions and displays the text with formatting. </p>
<A NAME="TI2581"></A><p>In an application, you may want to:<A NAME="TI2582"></A>
<ul>
<li class=fi>Provide
a window for preparing rich text documents<br>
Although not a full-fledged word processor, the RichTextEdit
control allows the user to apply formatting to paragraphs, words,
and characters.<br></li>
<li class=ds>Create a mail-merge application<br>
You or the user can set up boilerplate text with input fields
associated with database data.<br></li>
<li class=ds>Display reports with formatted text<br>
A RichText DataWindow object is designed for viewing data,
rather than entering data. It does not have the edit styles of other
DataWindow presentation styles.<br></li>
<li class=ds>Store rich text as a string in a database and display
it in a RichTextEdit control
</li>
</ul>
</p>
<A NAME="X-REF372618158"></A><h2>Sources of rich text</h2>
<A NAME="TI2583"></A><h4>Any word processor</h4>
<A NAME="TI2584"></A><p>You can prepare rich text in any word processor that can save
or export rich text format.</p>
<A NAME="TI2585"></A><h4>Input fields in PowerBuilder only</h4>
<A NAME="TI2586"></A><p>Although many word processors support some kinds of fields,
the fields are usually incompatible with other rich text interpreters.
If you want to specify input fields for a PowerBuilder application,
you will have to insert them using the PowerBuilder RichTextEdit
control.</p>
<A NAME="TI2587"></A><h4>Rich text in the database</h4>
<A NAME="TI2588"></A><p>Since rich text is represented by ASCII characters, you can
also store rich text in a string database column or string variable.
You can retrieve rich text from a string database column and use
the <b>PasteRTF</b> function to display the text with formatting
in a RichTextEdit control.</p>
<A NAME="TI2589"></A><h2>Deploying a rich text application</h2>
<A NAME="TI2590"></A><p>When you deploy a rich text application to a server or client
machine, you must also copy the rich text DLL and OCX files in the <i>Sybase\Shared\PowerBuilder\RTC</i> directory
to the PowerBuilder VM directory on the deployment machine or to
a directory in the application's path. <A HREF="apptechp247.htm#BAJFAHDA">Table 37-5</A> provides
the list of files you must copy.</p>
<A NAME="TI2591"></A><p>You can use the PowerBuilder Runtime Packager to deploy the
required rich text files with your application. However, you must
also register the <i>tp4ole11.ocx</i> file on the
deployment machine.</p>
<A NAME="TI2592"></A><p>For more information on the runtime packager, see <A HREF="apptechp245.htm#BAJDBEAB">"PowerBuilder Runtime Packager"</A>.</p>

